<?php

namespace app\admin\controller\wdsxh\single;
/**
 * 退款列表
 *
 * @icon fa fa-circle-o
 */
class Refund extends \app\admin\controller\wdsxh\mall\Refund
{
    public function _initialize()
    {
        parent::_initialize();
    }

    public function import()
    {
        parent::import();
    }
    /**
     * 查看
     */
    public function index()
    {
        //当前是否为关联查询
        $this->relationSearch = true;
        //设置过滤方法
        $this->request->filter(['strip_tags', 'trim']);
        if ($this->request->isAjax()) {
            //如果发送的来源是Selectpage，则转发到Selectpage
            if ($this->request->request('keyField')) {
                return $this->selectpage();
            }
            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
            $list = $this->model
                ->with(['mallorderrefund'])
                ->where($where)
                ->with(['goods'])
                ->where('refund_status','in',[1,2,3,4])
                ->order($sort, $order)
                ->paginate($limit);

            $result = array("total" => $list->total(), "rows" => $list->items());

            return json($result);
        }
        return $this->view->fetch();
    }

}
